<?php

use yii\db\Migration;

/**
 * Class m191029_234841_settings
 */
class m191029_234841_settings extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->execute(
            "CREATE TABLE {{%settings}} (
                `setId` int(11) NOT NULL AUTO_INCREMENT COMMENT '设置编号',
                `setName` varchar(200) DEFAULT NULL COMMENT '设置名称',
                `setTag` varchar(100) DEFAULT NULL COMMENT '设置标识',
                `setValue` text DEFAULT NULL COMMENT '设置内容',
                `description` text DEFAULT NULL COMMENT '设置说明',
                `ctime` int(11) DEFAULT NULL COMMENT '创建时间',
                PRIMARY KEY (`setId`)
            ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8"
        );
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%settings}}');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m191029_234841_settings cannot be reverted.\n";

        return false;
    }
    */
}
